class fuel {
  constructor(board) {
    this.ctx = board.ctx
    this.randomX = (Math.random() * 800) + 15
    this.y = -25
    this.width = 30
    this.height = 50
    this.speed = 2
    this.img = images['fuel']
    this.rotate = 0
    this.timer = null
    // this.frame()
  }
  darw() {
    this.rotate += 2
    this.y += this.speed
    this.ctx.save()
    this.ctx.translate(this.randomX, this.y)
    this.ctx.rotate(this.rotate * Math.PI / 180)
    this.ctx.drawImage(this.img, -15, -25, 30, 50)
    this.ctx.restore()
  }
  // frame() {
  //   cancelAnimationFrame(this.timer)
  //   this.timer = requestAnimationFrame(() => {
  //     this.frame()
  //   })
  //   this.darw()
  // }
}

export { fuel }